package com.wechat.back.pojo;


import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class User {
    @NotNull//不为null校验
    private Integer id;//主键ID

    private String username;//用户名

    @JsonIgnore //查询返回忽略password
    private String password;//密码

    @NotEmpty //不为null且内容不空
    @Pattern(regexp = "\\S{1,10}$") //校验1-10个字符
    private String nickname;//昵称

    private String sex;//性别

    private String locate; //地点

    @NotEmpty
    @Email //校验邮箱
    private String email;//邮箱
    private String phone;//手机号

    private String userPic;//用户头像地址

    private String userStatus; //状态
    private Integer userPower; //权限
    private String hobby;//爱好

    private LocalDateTime createTime;//创建时间

    private LocalDateTime updateTime;//更新时间
}
